package com.zjxf;

import com.zjxf.listener.ApplicationStartup;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.servlet.MultipartConfigElement;

/**
 * created with IntelliJ IDEA
 *
 * @author: create by limu
 * Date: 2021/3/16
 * Time：10:02
 */
@EnableSwagger2
@EnableJpaAuditing
@SpringBootApplication
@ServletComponentScan
public class LmcApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(LmcApplication.class);
        springApplication.addListeners(new ApplicationStartup());
        springApplication.run(args);
    }

    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory config = new MultipartConfigFactory();
        config.setMaxFileSize("10000MB");
        config.setMaxRequestSize("10000MB");
        return config.createMultipartConfig();
    }

}
